<!--%import("filter/delete_category.xml")-->
<!--%import("filter/move_category.xml")-->

<!--// tree javascript plugin load -->
<!--%load_js_plugin("ui.tree")-->

<load target="js/document_category.js" usecdn="true" />
<!--%load_js_plugin("ui.colorpicker")-->
<script>
    var category_title = "{$lang->category}";
</script>

<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/document/tpl/category_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<div id="menu">
	<ul class="simpleTree">
		<li class="root" id='tree_0'><span>{$lang->category}</span></li>
	</ul>
</div>
<div class="btnArea">
	<button type="button" onclick="doReloadTreeCategory('{$module_info->module_srl}')" class="x_btn">{$lang->cmd_remake_cache}</button>
</div>
<script>
	var simpleTreeCollection;
	var max_menu_depth = 999;
	var lang_confirm_delete = "{$lang->confirm_delete}";
	var xml_url = "{$category_xml_file}";

	jQuery(function($){
		Tree(xml_url);
	});
</script>

<section class="x_modal x" id="__category_info" hidden>
	<form ruleset="insertCategory" id="fo_category" action="./" method="post" class="x_form x_form-horizontal" style="margin:0">
		<input type="hidden" name="module" value="document" />
		<input type="hidden" name="act" value="procDocumentInsertCategory" />
		<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
		<input type="hidden" name="xml_file" value="{$category_xml_file}" />
		<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
		<input type="hidden" name="parent_srl" value="{$category_info->parent_srl}" />
		<input type="hidden" name="category_srl" value="{$category_info->category_srl}" />
		<input type="hidden" name="xe_validator_id" value="modules/document/tpl/category_list/1" />
		<div class="x_modal-header">
			<h1>{$lang->category}</h1>
		</div>
		<div class="x_modal-body">
			<div id="__parent_category_info" class="x_control-group">
				<label class="x_control-label">{$lang->parent_category_title}</label>
				<div class="x_controls">
					<span id="__parent_category_title" style="display:inline-block;padding:3px 0 0 0"></span>
				</div>
			</div>
			<div class="x_control-group">
				<label class="x_control-label" for="lang_category_title">{$lang->category_title}</label>
				<div class="x_controls">
					<input type="text" class="lang_code" name="category_title" id="category_title" value="" />
				</div>
			</div>
			<div class="x_control-group">
				<label class="x_control-label" for="category_color">{$lang->category_color}</label>
				<div class="x_controls">
					<span class="x_input-append"><input type="text" class="color-indicator" name="category_color" id="category_color" value="" /></span>
					<a href="#categoy_color_help" class="x_icon-question-sign" data-toggle>{$lang->help}</a>
					<p id="categoy_color_help" hidden style="margin:8px 0 0 0">{$lang->about_category_color}</p>
				</div>
			</div>
			<div class="x_control-group">
				<label class="x_control-label" for="lang_category_description">{$lang->category_description}</label>
				<div class="x_controls">
					<textarea name="category_description" class="lang_code" id="category_description" rows="8" cols="42"></textarea>
					<span class="x_help-block">{$lang->about_category_description}</span>
				</div>
			</div>
			<div class="x_control-group category_groups">
				<label class="x_control-label">{$lang->category_group_srls}</label>
				<div class="x_controls">
					<label loop="$group_list => $key, $val" class="x_inline" for="group_{$key}"><input type="checkbox" name="group_srls[]" value="{$key}" id="group_{$key}" /> {$val->title}</label>
					<span class="x_help-block">{$lang->about_category_group_srls}</span>
				</div>
			</div>
			<div class="x_control-group">
				<label class="x_control-label">{$lang->expand}</label>
				<div class="x_controls">
					<label class="x_inline" for="expand"><input type="checkbox" name="expand" value="Y" id="expand" /> {$lang->about_expand}</label>
				</div>
			</div>
		</div>
		<div class="x_modal-footer">
			<button type="button" class="x_btn x_pull-left" data-hide="#__category_info">{$lang->cmd_close}</button>
			<button type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_save}</button>
		</div>
	</form>
</section>
